package com.education.welco.service.impl;

import java.util.List;

import com.education.common.utils.Convert;
import com.education.welco.mapper.SHomewordClassMapper;
import com.education.welco.pojo.SHomewordClass;
import com.education.welco.service.ISHomewordClassService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 课后作业查看班级 服务层实现
 *
 * @author d
 * @date 2020-05-13
 */
@Service
public class SHomewordClassServiceImpl implements ISHomewordClassService {

    @Autowired
    private SHomewordClassMapper sHomewordClassMapper;

    /**
     * 查询课后作业查看班级信息
     *
     * @param id 课后作业查看班级ID
     * @return 课后作业查看班级信息
     */
    @Override
    public SHomewordClass selectSHomewordClassById(Integer id) {
        return sHomewordClassMapper.selectSHomewordClassById(id);
    }

    /**
     * 查询课后作业查看班级列表
     *
     * @param sHomewordClass 课后作业查看班级信息
     * @return 课后作业查看班级集合
     */
    @Override
    public List<SHomewordClass> selectSHomewordClassList(SHomewordClass sHomewordClass) {
        return sHomewordClassMapper.selectSHomewordClassList(sHomewordClass);
    }

    /**
     * 新增课后作业查看班级
     *
     * @param sHomewordClass 课后作业查看班级信息
     * @return 结果
     */
    @Override
    public int insertSHomewordClass(SHomewordClass sHomewordClass) {
        return sHomewordClassMapper.insertSHomewordClass(sHomewordClass);
    }

    /**
     * 删除课后作业查看班级
     *
     * @param workId 课后作业查看班级ID
     * @return 结果
     */
    @Override
    public int deleteSHomewordClassByCatalogId(Integer workId) {
        return sHomewordClassMapper.deleteSHomewordClassByCatalogId(workId);
    }

    /**
     * 修改课后作业查看班级
     *
     * @param sHomewordClass 课后作业查看班级信息
     * @return 结果
     */
    @Override
    public int updateSHomewordClass(SHomewordClass sHomewordClass) {
        return sHomewordClassMapper.updateSHomewordClass(sHomewordClass);
    }

    /**
     * 删除课后作业查看班级对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteSHomewordClassByIds(String ids) {
        return sHomewordClassMapper.deleteSHomewordClassByIds(Convert.toStrArray(ids));
    }

    @Override
    public int insertSHomewordClassList(List<SHomewordClass> sHomewordClassList) {
        return sHomewordClassMapper.insertSHomewordClassList(sHomewordClassList);
    }
}